package com.zking.dao;

import com.zking.pojo.Book;
import com.zking.pojo.Page;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface BookDao {
    int add(Book book);

    int update(Book book);

    int delete(Integer id);

    Book getById(Integer id);

    List<Book> getAll();

    //List<Book> selectBywhere(@Param("bname") String name,@Param("currentPage")Integer currentPage,@Param("pageSize")Integer pageSize);

    List<Book> selectBywhere(@Param("book") Book book, @Param("page")Page page);
    /*@Insert("insert into tb_book( type, name, description) values(#{type},#{name},#{description}) ")
    int add(Book book);

    @Update("update tb_book set type=#{type},name=#{name},description=#{description} where id=#{id}")
    int update(Book book);

    @Delete("delete from tb_book where id=#{id}")
    int delete(Integer id);

    @Select("select * from tb_book where id=#{id}")
    Book getById(Integer id);

    @Select("select * from tb_book")
    List<Book> getAll();*/
}
